﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Shape.Mvp.Sample.Views
{
   public partial class ExerciseDetailDialog : Form, IExerciseDetailView
   {
      public ExerciseDetailDialog()
      {
         InitializeComponent();
      }

      public string ExerciseId
      {
         get
         {
            throw new NotImplementedException();
         }
         set
         {
            throw new NotImplementedException();
         }
      }

      public string ExerciseName
      {
         get { return txtName.Text.Trim(); }
         set {txtName.Text = value; }
      }

      public event EventHandler Accepted;

      public event EventHandler Cancelled;

		public event Action ShowPositionList;

      public bool CanClose { get; set;}

      private void cmdOk_Click(object sender, EventArgs e)
      {
			if (Accepted != null)
			{
				Accepted(sender, e);

				if (CanClose) this.Close();
         }
      }

		private void button1_Click(object sender, EventArgs e)
		{
			if (ShowPositionList !=null)
			{
				ShowPositionList();
			}
		}

		public string StartingPosition
		{
			get
			{
				return label3.Text;
			}
			set
			{
				label3.Text = value;
			}
		}
	}
}
